package xkp.lesson4;

import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;

public class TestLambda2 {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("张三","李四","王五");
        //list.forEach(t->MyClass.fun1(t));
        list.forEach(MyClass::fun1);//对类中静态方法的引用
        MyClass myClass = new MyClass();
        //list.forEach(t->myClass.fun2(t));
        list.forEach(myClass::fun2);


        //Supplier<Object> supplier = ()->new MyClass();
        //构造方法引用
        Supplier<Object> supplier = MyClass::new;
    }
}
